<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>全部教师信息</title>
    <link rel="stylesheet" href="func1.css">
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div id="header">全部教师信息</div>
<div id="banner">
    <form id="search" action="http://localhost:8080/ClassroomManageSystem_war_exploded/func1Servlet?action=SelectTeacherByName" method="post">
        <input type="text" id="searchmsg" name="searchmsg" placeholder="请输入教师姓名">
        <input type="submit" value="搜索" id="sub">
    </form>
</div>


<table border="1" id="content">
    <tr>
        <th>教师编号</th>
        <th>教师姓名</th>
        <th>教授课程</th>
        <th>职称</th>
    </tr>
    <th><a href="http://localhost:8080/ClassroomManageSystem_war_exploded/add_teacher.jsp">添加教室</a></th>
    <c:forEach items="${requestScope.teachers}" var="teacher">
        <tr>
            <td>${teacher.tid}</td>
            <td>${teacher.tname}</td>
            <td>${teacher.course}</td>
            <td>${teacher.level}</td>
        </tr>
    </c:forEach>
    <c:choose>
        <c:when test="${requestScope.teacherSearch != null}">
            <c:forEach items="${requestScope.teacherSearch}" var="search">
                <tr>
                    <td>${search.tid}</td>
                    <td>${search.tname}</td>
                    <td>${search.course}</td>
                    <td>${search.level}</td>
                </tr>
            </c:forEach>
        </c:when>
        <c:when test="${requestScope.msg != null}">
            <h4>${requestScope.msg}</h4>
        </c:when>
    </c:choose>

</table>
</body>
